package com.wwl.cms.utils.JVMTest;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/5/26 18:29
 * @description:
 *
 * s
 */
public class HeapSpaceInitial {
    public static void main(String[] args) {
        //虚拟机堆内存总量
      Long initialMemory =  Runtime.getRuntime().totalMemory()/1024/1024;

      Long maxMemory = Runtime.getRuntime().maxMemory()/1024/1024;

      System.out.println("-Xms :"+ initialMemory + "M");
      System.out.println("-Xmx :"+ maxMemory + "M");

        System.out.println("系统内存大小 :"+ initialMemory *64 /1024 + "G");
        System.out.println("-系统内存大小 :"+ maxMemory *4 /1024+ "G");

    }
}
